package com.cashmama.market.api.application.controller.website;

import com.cashmama.market.api.application.annos.SignIgnore;
import com.cashmama.market.api.application.annos.VisitorAccessible;
import com.cashmama.market.api.domain.service.ApiUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @program: market-api
 * @description 官网使用
 * @author: frank
 * @create: 2020-01-08 11:25
 **/
@Controller
@RequestMapping("/website/")
public class WebSiteJumpController {

    @Autowired
    private ApiUserService apiUserService;

    /**
     * 官网用户行为
     * @return
     */
    @SignIgnore
    @VisitorAccessible
    @RequestMapping(value = "/promotion/init")
    public String websitePromotionInit(String userCode,String jumpUrl) {
        apiUserService.initPromotion(userCode);
        return "redirect:" + jumpUrl;
    }
}
